Repository navigation
restore: stop writing *.backup.<epoch> copies into the project - #21
Merged
Merged
Conversation
restoreConfigurations saved every file it was about to overwrite as `<file>.backup.<epoch>` next to it, so each `roll pull` whose archived .env.roll, env.php, auth.json or composer.lock differed from the local copy left another file in the project root and app/etc: credentials included, 1.3 MB per composer.lock, and usually hidden by the project's .gitignore. Nobody used them. .env.roll and composer.* are tracked and come back with `git checkout`, and after a pull the archived env.php and auth.json are the ones wanted. The restore now overwrites without keeping a copy. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
marcepartment
requested review from
HeRovaZy,
epartment-nick and
mlaurense
and
a balanced review from Copilot
November 9, 2026 13:16
There was a problem hiding this comment.
🟡 Changes recommended
The encrypted restore truncates the existing configuration before decryption succeeds, so a decryption failure can leave it empty or partial with no recovery copy.
1 open issue
What changed in this PR
This PR stops configuration restores from leaving timestamped backup copies in project directories, reducing clutter and leftover credential files during roll restore and roll pull.
Changes:
- Removes the pre-overwrite configuration backup step.
- Documents overwrite behavior, preservation advice, and how to locate old copies.
- Adds a changelog entry describing the change.
| File | Description |
|---|---|
utils/backup.sh |
Removes creation of configuration recovery copies before overwriting. |
docs/backup-restore.md |
Explains overwrite behavior and locating old backup files. |
CHANGELOG.md |
Records the removal of timestamped restore backups. |
Review effort: Balanced
| fi | ||
| fi | ||
|
|
||
| # The existing file is overwritten without keeping a copy. Restores used to save it as |
`gpg --decrypt ... > "$target_path"` truncated the target before decryption started, so a wrong passphrase or a damaged archive left an empty env.php or auth.json. With the pre-restore copies gone that was unrecoverable. decryptConfigInto decrypts into a mktemp file next to the target and writes the target only on success (cat, so its owner and mode stay), for both the structured and the legacy backup layout. Raised by Copilot on #21. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Problem
Before overwriting a project's configuration files with the archived copies,
restoreConfigurations(utils/backup.sh) saved each file it was about to change as<file>.backup.<epoch>next to the original.roll pullrunsroll restore, so every pull whose.env.roll,app/etc/env.php,auth.json,composer.jsonorcomposer.lockdiffered from the build server's added another copy to the project root andapp/etc:.env.roll.backup.*per shop, 1.3 MB percomposer.lock.backup.*);env.phpandauth.jsoncopies;.gitignore, so it piles up unnoticed, and where it is not ignored agit add -Awould commit it.Fix
The restore now overwrites without keeping a copy. Nobody used them:
.env.rollandcomposer.*are tracked in the shops checked, sogit checkout -- <file>brings a local version back, and after a pull the archivedenv.phpandauth.jsonare the ones wanted.roll config set/version/fix-pinsstill write.env.roll.backup.<date>. Those only happen on an explicit command that prints the path, so they are left as they are.Verification
Calling
restoreConfigurationsdirectly against a fake backup whose.env.roll,env.phpandauth.jsondiffer from the project's, withmainas the control:*.backup.*filesgit statusmain.github/scripts/smoke.sh bash32passes.docs/backup-restore.mdexplains the overwrite and how to list the old leftovers. The CHANGELOG has a "Fixed" entry.🤖 Generated with Claude Code